package com.learn.base.test;

import org.junit.Test;

import java.util.HashMap;

public class HashMapInfiniteLoop {


    private static HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(2,0.75f);


    @Test
    public void put() {

        map.put(5, 55);
        new Thread("thread1"){
            @Override
            public void run() {
                map.put(7, 77);
                System.out.println(map);
            }
        }.start();
        new Thread("thread2") {
            @Override
            public void run() {
                map.put(3, 33);
                System.out.println(map);
            }
        }.start();
    }
}
